package com.hawthorn.admin.repository;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hawthorn.admin.repository.provider.SysUserSqlProvider;
import com.hawthorn.entity.po.SysUserPO;
import com.hawthorn.platform.repository.DBMapper;
import org.apache.ibatis.annotations.SelectProvider;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>todo SysUser Mapper类</p>
 * @author: andyten@tom.com | xukaixing@hotmail.com
 * @created: 2021/11/11 8:33 PM
 * @version v1.0.1
 * @copyright: Copyright (c)  andyten
 */
@Repository
public interface SysUserMapper extends DBMapper<SysUserPO>
{
  //@SelectProvider(SysUserSqlProvider.class)
  // IPage<Map<String, Object>> findUsers(Page<Map<String, Object>> page, Map<String, QcBean> qc);

  @SelectProvider(SysUserSqlProvider.class)
  Integer findUserByAccount(String account);

  @SelectProvider(SysUserSqlProvider.class)
  IPage<Map<String, Object>> findUserLoginInfo(Page<Map<String, Object>> page, String qc);

  @SelectProvider(SysUserSqlProvider.class)
  IPage<Map<String, Object>> findUsers(Page<Map<String, Object>> page, String conditions);

  @SelectProvider(SysUserSqlProvider.class)
  IPage<Map<String, Object>> findUsersList(Page<Map<String, Object>> page, String conditions);

  @SelectProvider(SysUserSqlProvider.class)
  IPage<Map<String, Object>> findDealerUsers(Page<Map<String, Object>> page, String conditions);

  @SelectProvider(SysUserSqlProvider.class)
  List<Map<String, Object>> exportUsers(String headFields, String conditions);

  @SelectProvider(type = SysUserSqlProvider.class)
  Map<String, Object> selectUserInfoById(String userId);

  @SelectProvider(SysUserSqlProvider.class)
  Integer findUserByMobile(String mobile);

  @SelectProvider(SysUserSqlProvider.class)
  Integer selectCustomerCount(Long deptId, Long userId);

  @SelectProvider(SysUserSqlProvider.class)
  List<String> selectUserList(Long deptId);

  @SelectProvider(SysUserSqlProvider.class)
  Map<String, Object> selectUserInfo(String userId);
}
